package com.wubo.sec.filter;

import com.wubo.sec.SecurityManager;
import com.wubo.sec.model.Group;

public class GroupBeforeFilter implements IDataBeforeFilter {
	
	public String sift() {
		Group group = SecurityManager.getCurrentUser().getGroup();
		
		boolean markLocked = group.isMarkLocked();
	
		if(markLocked){
			String mark = group.getMark();
			return " and g.priority < "+group.getPriority()+" and g.mark = '"+mark+"'";
		}else{
			return " and g.priority < "+group.getPriority();
		}
	}
}
